import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import show from '../atom/show';
import hide from '../atom/hide';

export default async function a003(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	//  是否有有效期限至
	const v = fd.data.node.querySelector<HTMLSelectElement>('[name="purchase_right"]').value;
	const n = fd.data.node.querySelector<HTMLDivElement>('[data-feidao-id="enddate_div"]');
	if (v == '是') {
		const f = fd.data.node.querySelector<HTMLFormElement>('#certifi_info_update_form');
		const effectivedate = f.effectivedate.value;
		f.enddate.min = effectivedate;
		show(n);
	} else {
		hide(n);
	}
}
